//! [transform example]
#include <iostream>
#include <vector>
#include <range/v3/view/transform.hpp>
#include <range/v3/view/iota.hpp>
#include <range/v3/view/filter.hpp>

int main()
{
    std::vector<int> numbers{1, 2, 3};

    auto halved = numbers
        // Divide each integer by 2, converting it into a double
        | ranges::views::transform([](const int& num) {
          return num / 2.0;
        });

    std::cout << halved << '\n';

    auto numbers1 = ranges::views::ints(3, 7);
    std::cout << numbers1 << '\n';


    std::vector<int> numbers2{1, 2, 3, 4};
    auto even = numbers2
        // Keep only the even numbers
        | ranges::views::filter([](const int& num) {
          return num % 2 == 0;
        });
    std::cout << even << '\n';
}
//! [transform example]
